package xyz.keyon.listener;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

/**
 * @author Keyon
 * @explain HttpSessionAttributeListener监听器
 *          监听HttpSession域对象
 * @creat time 2019/10/27 19:49
 */
public class MyHttpSessionAttrListener implements HttpSessionAttributeListener {

    @Override
    public void attributeAdded(HttpSessionBindingEvent hsbe) {
        System.out.println(hsbe.getName());
        System.out.println(hsbe.getValue());
    }

    @Override
    public void attributeRemoved(HttpSessionBindingEvent hsbe) {
        System.out.println(hsbe.getName());
        System.out.println(hsbe.getValue());
    }

    @Override
    public void attributeReplaced(HttpSessionBindingEvent hsbe) {
        System.out.println(hsbe.getName());
        System.out.println(hsbe.getValue());
    }
}
